package de.schmidke.palmreader;

import java.io.IOException;

public class PalmPhoneNumber extends Readable {
	public PalmPhoneNumber() {
	}

	public PalmPhoneNumber(String number) {
		this.number = number;
		this.labelid = 0;
	}

	private boolean isDefault;

	public boolean isDefault() {
		return isDefault;
	}

	public void setDefault(boolean isDefault) {
		this.isDefault = isDefault;
	}

	private int labelid;
	private String number;

	public int getLabelid() {
		return labelid;
	}
	
	public void setLabelId(int value) {
		labelid = value;
	}

	public String getLabel() {
		return PalmReader.getProps().getProperty("phonelabel." + getLabelid(),
				"phonelabel-" + getLabelid());
	}

	public String getNumber() {
		return number;
	}

	@Override
	protected void load() throws IOException {
		labelid = readTypedInt();
		number = readTypedString();
	}

	@Override
	public String toString() {
		return "PalmPhoneNumber[number='" + number + "' labelid=" + labelid + "]";
	}
	
	
}
